package com.qf.bean;

import javax.persistence.*;
import java.util.Date;

/**
 * 2019/11/30
 * Administrator
 * springdata1130
 * 面向对象面向君  不负代码不负卿
 */
@Entity//默认情况下，类名=表名
public class Teacher{
    @Override
    public String toString() {
        return "Teacher{" +
                "tid=" + tid +
                ", tname='" + tname + '\'' +
                ", tsex='" + tsex + '\'' +
                ", birthday=" + birthday +
                '}';
    }

    public Teacher(String tname, String tsex, Date birthday) {
        this.tname = tname;
        this.tsex = tsex;
        this.birthday = birthday;
    }

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)//设置主键的生成方式.IDENTITY主键自增，适用于sqlserver,mysql
    private Integer tid;
    @Column
    private String tname;
    @Column
    private String tsex;
    @Column
    private Date birthday;

    public Teacher() {
    }

    public Integer getTid() {
        return tid;
    }

    public void setTid(Integer tid) {
        this.tid = tid;
    }

    public String getTname() {
        return tname;
    }

    public void setTname(String tname) {
        this.tname = tname;
    }

    public String getTsex() {
        return tsex;
    }

    public void setTsex(String tsex) {
        this.tsex = tsex;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }
}
